﻿using System.Linq.Expressions;
using Shop.Model.Category;
using Shop.Model.DB;
using Shop.RemoteModel.Category.Model;

namespace Shop.Collect
{
    public interface ICategoryCollect
    {
        void CheckRepeat (long parentId, string name);
        GoodsCategory[] GetAll ();

        long Add (CategoryAdd add);

        void Move (DBCategory source, DBCategory to);

        bool Set (DBCategory source, CategorySet set);

        long[] GetSubId (DBCategory category);

        void Delete (DBCategory category, long[] subId);

        DBCategory Get (long id);
        Result Get<Result> (long id, Expression<Func<DBCategory, Result>> selector);
        Result Get<Result> (long id) where Result : class;

        void Stop (DBCategory category);

        void Enable (DBCategory category);

        Result[] Gets<Result> (GoodsCategoryGet param) where Result : class, new();

        Dictionary<long, int> SetSort (DBCategory category, int sort);
        string[] GetNameList (long[] ids);
        Dictionary<long, string> GetNames (long[] ids);
        Dictionary<long, string> GetFullNames (long[] ids);
    }
}